<template>
    <div id="say">
        <div class="card">
            <p>
                <span>📣 {{ day }}</span>
            </p>
            <p>
                <span>{{ say }}</span>
            </p>
            <p></p>
            <div v-for="h in nextFourHoliday">
                <p>距离{{ h.name }}还有{{ h.day }}天</p>
            </div>
        </div>
    </div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { getOneSay, getDay, getNextHoliday } from '../api/oneSay';
import { holiday } from '../type/holiday';

const say = ref()
const day = ref()
const nextFourHoliday = ref<holiday[]>()

getNextHoliday().then(res => {
    nextFourHoliday.value = res.data.data
    console.log(nextFourHoliday.value)
})

getOneSay().then(res => {
    say.value = res.data.hitokoto
})

day.value = getDay()

</script>
<style scoped>
#say {
    margin-top: 10px;
}

#say .card {
    padding: 20px;
    margin-bottom: 20px;
    color: #8a6d3b;
    background-color: #fcf8e3;
    border: 1px solid #faebcc;
    border-radius: 20px;
    line-height: 1.4em;
    font-size: 14px;
    text-align: left;
}
</style>